<UserControl x:Class="Microsoft.Robotics.Manipulation.Visualization.ArmPositionDisplayView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="776.866" d:DesignWidth="617.91">
    <Grid RenderTransformOrigin="0.386,0.493" Margin="0,19,-299,-483" ToolTip="Sync values with Current values">
        <Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="346" Margin="12,10,-5,0" VerticalAlignment="Top" Width="583"/>
        <Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="182" Margin="301,390,-3,-104" VerticalAlignment="Top" Width="292"/>
        <Label Content="CartesianPosition" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="141" FontWeight="Bold"/>
        <Label Content="Current" HorizontalAlignment="Left" Margin="82,33,0,0" VerticalAlignment="Top" Width="53" RenderTransformOrigin="1.623,0.577"/>
        <Label Content="Target" HorizontalAlignment="Left" Margin="402,33,0,0" VerticalAlignment="Top" Width="49"/>
        <Label Content="JointPosition" HorizontalAlignment="Left" Margin="10,585,0,-140" VerticalAlignment="Top" Width="92" FontWeight="Bold"/>
        <Label Content="Current" HorizontalAlignment="Left" Margin="12,612,0,-167" VerticalAlignment="Top" Width="53"/>
        <Label Content="Target" HorizontalAlignment="Left" Margin="12,640,0,-195" VerticalAlignment="Top" Width="49"/>
        <Label Content="Delta" HorizontalAlignment="Left" Margin="12,670,0,-225" VerticalAlignment="Top" Width="41"/>
        <TextBlock x:Name="CurrentJointPosition" HorizontalAlignment="Left" Height="23" Margin="70,614,0,-169" TextWrapping="Wrap" Text="{Binding CurrentJointPosition}" VerticalAlignment="Top" Width="408"/>
        <TextBlock HorizontalAlignment="Left" Height="23" Margin="70,642,0,-197" TextWrapping="Wrap" Text="{Binding TargetJointPosition}" VerticalAlignment="Top" Width="408"/>
        <TextBlock HorizontalAlignment="Left" Height="23" Margin="70,670,0,-225" TextWrapping="Wrap" Text="{Binding DeltaJointPosition}" VerticalAlignment="Top" Width="408"/>

        <Label Content="Manual" HorizontalAlignment="Left" Margin="10,698,0,-253" VerticalAlignment="Top" Width="51" Height="23"/>
        <TextBox x:Name="JointManualEntry" HorizontalAlignment="Left" Height="23" Margin="61,701,0,-256" TextWrapping="Wrap" VerticalAlignment="Top" Width="357" Text="{Binding JointManualEntry, Mode=OneWayToSource}"/>
        <Button x:Name="JointSync" Content="Sync" HorizontalAlignment="Left" Margin="442,701,0,-253" VerticalAlignment="Top" Width="56" Click="JointSync_Click"/>
        <Button x:Name="JointUpdate" Content="Update" HorizontalAlignment="Left" Margin="513,701,0,-253" VerticalAlignment="Top" Width="51" Click="JointUpdate_Click" ToolTip="Sends JointControl with these values"/>
        <CheckBox x:Name="JointUpdateCheckBox" Content="CheckBox" HorizontalAlignment="Left" Margin="206,303,0,0" VerticalAlignment="Top" Visibility="Hidden" IsChecked="{Binding DoJointUpdate}"/>

        <!-- Position and orientation information for Cartesian Control-->
        <Label Content="Position:  " HorizontalAlignment="Left" VerticalAlignment="Top" Margin="45,59,0,0" Width="75"/>
        <Label Content="Orientation:  " HorizontalAlignment="Left" VerticalAlignment="Top" Margin="27,85,0,0" Width="75" RenderTransformOrigin="0.48,1.885"/>

        <Label x:Name="CartesianPositionLabel" Content="{Binding CurrentCartesianPosition}" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="125,59,0,0" Width="273" />
        <Label x:Name="CartesianOrientationLabel" Content="{Binding CurrentCartesianOrientation}" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="125,85,0,0" Width="273"/>

        <Label x:Name="CartesianTargetPositionLabel" Content="{Binding TargetCartesianPosition}" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="426,59,-94,0" Width="258"/>
        <Label x:Name="CartesianTargetOrientationLabel" Content="{Binding TargetCartesianOrientation}" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="426,85,-94,0" Width="258"/>

        <Button x:Name="AddCartesianPositionButton" Content="Add/Update" HorizontalAlignment="Left" Margin="27,283,0,0" VerticalAlignment="Top" Width="75" Click="AddUpdatePosition_Click" ToolTip="Adds or updates the currently named position in list box"/>
        <CheckBox x:Name="UpdateCartesianPositionCheckBox" Content="CheckBox" HorizontalAlignment="Left" Margin="206,303,0,0" VerticalAlignment="Top" Visibility="Hidden" IsChecked="{Binding DoUpdatePosition}"/>

        <Button x:Name="GoToCartesianPosition" Content="GoTo" HorizontalAlignment="Left" Margin="505,319,0,0" VerticalAlignment="Top" Width="75" Click="GoToPosition_Click" ToolTip="Sends JointControl with these values"/>
        <ListBox x:Name="PositionsListBox" HorizontalAlignment="Left" Height="100" Margin="303,241,0,0" VerticalAlignment="Top" Width="191" SelectionChanged="ListBox_SelectionChanged_1"  SelectedItem="{Binding CurrentlySelectedCartesianPositionName}" ItemsSource="{Binding CartesianPositionNames, Mode=OneWay}" />
        <CheckBox x:Name="GoToPositionCheckBox" Content="CheckBox" HorizontalAlignment="Left" Margin="206,303,0,0" VerticalAlignment="Top" Visibility="Hidden" IsChecked="{Binding DoGoToPosition}"/>
        <TextBox x:Name="PositionNameTextBox" HorizontalAlignment="Left" Height="23" Margin="125,280,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="130" Text="{Binding CurrentCartesianPositionName, Mode=OneWayToSource}"/>

        <Button x:Name="LoadButton" Content="Load" HorizontalAlignment="Left" Margin="505,268,0,0" VerticalAlignment="Top" Width="75" Click="LoadPositions_Click" ToolTip="Loads list of positions"/>
        <Button x:Name="SaveButton" Content="Save" HorizontalAlignment="Left" Margin="505,241,0,0" VerticalAlignment="Top" Width="75" Click="SavePositions_Click" ToolTip="Saves list of positions"/>
        <CheckBox x:Name="LoadPositionsCheckBox" Content="CheckBox" HorizontalAlignment="Left" Margin="206,303,0,0" VerticalAlignment="Top" Visibility="Hidden" IsChecked="{Binding LoadCartesianPositions}"/>
        <CheckBox x:Name="SavePositionsCheckBox" Content="CheckBox" HorizontalAlignment="Left" Margin="206,303,0,0" VerticalAlignment="Top" Visibility="Hidden" IsChecked="{Binding SaveCartesianPositions}"/>

        <!-- Cartesian touch parameters/button -->
        <Label Content="Force threshold (N):" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,446,0,-1" Width="258"/>
        <Label Content="Max lin speed (M/s):" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,472,0,-27" Width="258"/>
        <Label Content="Max rot speed (rad/s):" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,498,0,-53" Width="258"/>

        <TextBox x:Name="ForceThresholdTextBox" HorizontalAlignment="Left" Height="23" Margin="149,449,0,-4" TextWrapping="Wrap" VerticalAlignment="Top" Width="40" Text="{Binding TouchForceThresholdText, Mode=OneWayToSource}"/>
        <TextBox x:Name="TouchMaxLinSpeedTextBox" HorizontalAlignment="Left" Height="23" Margin="149,474,0,-29" TextWrapping="Wrap" VerticalAlignment="Top" Width="40" Text="{Binding TouchMaxLinSpeedText, Mode=OneWayToSource}"/>
        <TextBox x:Name="TouchMaxRotSpeedTextBox" HorizontalAlignment="Left" Height="23" Margin="149,498,0,-53" TextWrapping="Wrap" VerticalAlignment="Top" Width="40" Text="{Binding TouchMaxRotSpeedText, Mode=OneWayToSource}"/>
        <Button x:Name="TouchCartesianPositionButton" Content="Touch" HorizontalAlignment="Left" Margin="194,498,0,-50" VerticalAlignment="Top" Width="75" Click="TouchPosition_Click" ToolTip="Initiate touch with these values"/>
        <CheckBox x:Name="TouchCartesianPositionCheckBox" Content="CheckBox" HorizontalAlignment="Left" Margin="206,303,0,0" VerticalAlignment="Top" Visibility="Hidden" IsChecked="{Binding DoTouchPosition}"/>
        <Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="91" Margin="10,440,0,-63" VerticalAlignment="Top" Width="268"/>

        <!-- Cartesian push parameters/button -->
        <Label Content="Push axis force threshold:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="315,396,0,0" Width="258"/>
        <TextBox x:Name="PushForceThresholdTextBox" HorizontalAlignment="Left" Height="23" Margin="461,399,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="72" Text="{Binding PushAxisForceThresholdText, Mode=OneWayToSource}"/>
        <Label Content="Residual axis force threhsold:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="297,423,0,0" Width="258"/>
        <TextBox x:Name="ResidualForceThresholdTextBox" HorizontalAlignment="Left" Height="23" Margin="461,423,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="72" Text="{Binding PushResidualAxisForceThresholdText, Mode=OneWayToSource}"/>
        <Label Content="Push axis:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="297,444,0,0" Width="258"/>
        <Label Content="X:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="364,444,0,0" Width="27"/>
        <TextBox x:Name="PushAxisTextBoxX" HorizontalAlignment="Left" Height="23" Margin="391,447,0,-2" TextWrapping="Wrap" VerticalAlignment="Top" Width="43" Text="{Binding PushAxisXText, Mode=OneWayToSource}"/>
        <Label Content="Y:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="441,444,0,0" Width="27"/>
        <TextBox x:Name="PushAxisTextBoxY" HorizontalAlignment="Left" Height="23" Margin="461,446,0,-1" TextWrapping="Wrap" VerticalAlignment="Top" Width="43" Text="{Binding PushAxisYText, Mode=OneWayToSource}"/>
        <Label Content="Z:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="521,444,0,0" Width="27"/>
        <TextBox x:Name="PushAxisTextBoxZ" HorizontalAlignment="Left" Height="23" Margin="548,447,-1,-2" TextWrapping="Wrap" VerticalAlignment="Top" Width="43" Text="{Binding PushAxisZText, Mode=OneWayToSource}"/>
        <Label Content="Max lin speed (m/s):" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="337,481,-5,-36" Width="258"/>
        <TextBox x:Name="PushMaxLinSpeedTextBox" HorizontalAlignment="Left" Height="23" Margin="461,484,0,-39" TextWrapping="Wrap" VerticalAlignment="Top" Width="72" Text="{Binding PushMaxLinSpeedText, Mode=OneWayToSource}"/>
        <Label Content="Max rot speed (rad/s):" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="329,507,0,-62" Width="258"/>
        <TextBox x:Name="PushMaxRotSpeedTextBox" HorizontalAlignment="Left" Height="23" Margin="461,509,0,-64" TextWrapping="Wrap" VerticalAlignment="Top" Width="72" Text="{Binding PushMaxRotSpeedText, Mode=OneWayToSource}"/>
        <Button x:Name="PushCartesianButton" Content="Push" HorizontalAlignment="Left" Margin="403,538,0,-90" VerticalAlignment="Top" Width="75" Click="PushPosition_Click" ToolTip="Initiation touch with these values"/>
        <CheckBox x:Name="PushCartesianCheckBox" Content="CheckBox" HorizontalAlignment="Left" Margin="206,303,0,0" VerticalAlignment="Top" Visibility="Hidden" IsChecked="{Binding DoPushPosition}"/>

        <Label Content="Position" HorizontalAlignment="Left" Margin="37,135,0,0" VerticalAlignment="Top"/>
        <Label Content="Orient" HorizontalAlignment="Left" Margin="37,174,0,0" VerticalAlignment="Top"/>
        <TextBox x:Name="CartesianPositionManual" HorizontalAlignment="Left" Height="23" Margin="104,138,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="308" Text="{Binding CartesianPositionManual, Mode=OneWayToSource}"/>
        <TextBox x:Name="CartesianOrientationManual" HorizontalAlignment="Left" Height="23" Margin="104,179,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="308" Text="{Binding CartesianOrientationManual, Mode=OneWayToSource}"/>
        <Button x:Name="CartesianSync" Content="Sync" HorizontalAlignment="Left" Margin="433,151,0,0" VerticalAlignment="Top" Width="56" Click="CartesianSync_Click" ToolTip="Copies current cartesian values to manual boxes" />
        <Button x:Name="CartesianUpdate" Content="Update" HorizontalAlignment="Left" Margin="518,151,0,0" VerticalAlignment="Top" Width="51" Click="CartesianManualUpdate_Click" ToolTip="Sends Catesian Move with these values"/>
        <CheckBox x:Name="CartesianManualUpdateCheckBox" Content="CheckBox" HorizontalAlignment="Left" Margin="206,303,0,0" VerticalAlignment="Top" Visibility="Hidden" IsChecked="{Binding DoCartesianManualUpdate}"/>
        <Label Content="Touch Force" HorizontalAlignment="Left" Margin="12,390,0,0" VerticalAlignment="Top" Width="92" FontWeight="Bold"/>
        <TextBlock x:Name="CurrentAxisAngle" HorizontalAlignment="Left" Margin="125,117,0,0" TextWrapping="Wrap" Text="{Binding CurrentAxisAngle}" VerticalAlignment="Top" Width="209" Height="16"/>
        <Label Content="Axis Angle" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="27,113,0,0" Width="75" RenderTransformOrigin="0.48,1.885"/>
        <Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="200" Margin="10,380,-5,-112" VerticalAlignment="Top" Width="585"/>
        <Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="149" Margin="10,585,-5,-266" VerticalAlignment="Top" Width="585"/>

    </Grid>
</UserControl>
